package com.twu.biblioteca;

import java.io.*;
import java.util.ArrayList;

public class Biblioteca {

    private Menu menu;
    private Option option;
    private PrintStream printStream;
    private UserInputReader userInputReader;

    public Biblioteca(UserInputReader userInputReader, PrintStream printStream, Library library, MovieCollection movieCollection, LibraryPatrons libraryPatrons) {
        this.printStream = printStream;
        this.userInputReader = userInputReader;
        menu = new Menu(printStream);
        option = new Option(printStream, library, userInputReader, new BookReserver(printStream, userInputReader, library), movieCollection, libraryPatrons);
    }

    public void run() throws IOException {
        welcomeUser();
        menu.showOptions(false);
        option.validateOption(userInputReader.readUserInput());
    }

    public void welcomeUser() {
        printStream.println("Welcome!");
    }

}
